package com.sixth.volunteerservicesystem.Controller.ExamController.backExam;

import com.sixth.volunteerservicesystem.Dao.QuestionRepository;
import com.sixth.volunteerservicesystem.domain.Subjects;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

/**
 * @author Steve Jobs
 * @create 2021-01-11 13:01
 */
@Controller
public class UpdateSubjectsBack {
    @Autowired
    QuestionRepository questionRepository;

    @PostMapping("updateSubjectsBack/{id}")
    public String updateSubjectsBack(Subjects subjects,@PathVariable("id") Integer id){
        subjects.setSubjectId(id);

        questionRepository.save(subjects);


        return "redirect:/backExamList";
    }

}
